﻿using System;

namespace SmartCard.Framework
{
	public interface ISmartCardReader
	{
		#region events

		/// <summary>
		/// Signaled when a card is inserted
		/// </summary>
		event EventHandler<CardInsertedEventArgs> CardInserted;

		/// <summary>
		/// Signaled when a card is removed
		/// </summary>
		event EventHandler<CardRemovedEventArgs> CardRemoved;

		/// <summary>
		/// Signaled when the reader has a non-fatal error
		/// </summary>
		event EventHandler<ReaderErrorEventArgs> ReaderError;

		#endregion

		#region properties

		/// <summary>
		/// A friendly non-localized name for the reader 
		/// </summary>
		string FriendlyName
		{ get; }

		/// <summary>
		/// The type of reader
		/// </summary>
		eReaderType ReaderType
		{ get; }

		#endregion

		#region methods

		/// <summary>
		/// Gets the inserted card
		/// </summary>
		/// <returns>null if no card is inserted<returns>
		ICard GetInsertedCard();

		bool ContainsCard();

		#endregion
	}
}
